from pylib import models
from pylib import web

from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app


class ViewChanges(web.BaseHandler):
  @web.retry
  def get(self):
    query = models.Change.all().order('-changed_at')
    self.render_response('view_changes.html',
                         changes=query.fetch(limit=50))


application = webapp.WSGIApplication([('.*', ViewChanges)])

def main():
  run_wsgi_app(application)

if __name__ == "__main__":
  main()
